Skip to content

Conversation

@marinaaisa
Copy link
Member

Bug/issue #158778571, if applicable:

Summary

In the use cases of navigators with multiple top-level root and multiple languages, we want to make sure that the URL queries that are added in different languages don't interfere with the election of the top-level root node.

Before, we were reading the window.location.href, which includes queries. Now, by using the window.location.pathname property, we ignore the queries, which makes possible to compare with the node.path value to find which it's the correct top-level root.

Example: URL: http://localhost:8080/documentation/foo?language=objc
Navigator path: /documentation/foo

By using window.location.pathname we ignore ?language=objc and we can compare /documentation/foo with /documentation/foo

Dependencies

NA

Testing

Steps:

  1. Run DocC Render with a .doccarchive that has a navigator with multiple top-level roots and multiple languages (Swift, Obj-C)
  2. Assert that the navigators are rendering correctly

Checklist

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

In the use cases of navigators with multiple top-level root, we want to
make sure that queries don't interfere with the election of the
top-level root node when extracting the root node.

Before we were reading the window.location.href, which includes queries.
Now, by using the window.location.pathname, we ignore the queries, which
makes possible to compare with the node.path value to find which it's
the correct top-level root.

Example: URL: 'http://localhost:8080/documentation/foo?language=objc'
Navigator path: '/documentation/foo'

By using `window.location.pathname` we ignore `?language=objc` and we
can compare `/documentation/foo` with `/documentation/foo`
@marinaaisa marinaaisa requested a review from mportiz08 November 25, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant